<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

var years=Number(prompt('请输入年'));
        var month=Number(prompt('请输入月'));
        var day=Number(prompt('请输入日'));
        function getDay(years, month , day){
            //天数
            var days=day;
            if (month == 1) {  
                return days;
            }
            var months=[31,28,31,30,31,30,31,31,30,31,30,31];
            for (var i=0;i<month-1;i++) {   
                days += months[i];
            }
            if (isRn(years)  && month>2) {
                days++;         
            }
            return days;    
        }
        function isRn(num) {
            return num % 4 == 0 && num % 100 != 0 || num % 400 == 0;
        }
        document.write('今天是'+getDay(years, month , day)+'天');
    </script>
</body>
</html>